
	function OverlayMenuOnMouseOver(ctrl)
	{
		ctrl.style.color = '#000000';
		ctrl.style.background = '#E6EEF9';
	}
	function OverlayMenuOnMouseOut(ctrl)
	{
		ctrl.style.color = '#000000';
		ctrl.style.background = '#ffffff';
	}

	function getLeft(l)
	{
		if (l.offsetParent) return (l.offsetLeft + getLeft(l.offsetParent));
		else return (l.offsetLeft);
	}
	function getTop(l)
	{
		if (l.offsetParent) return (l.offsetTop + getTop(l.offsetParent));
		else return (l.offsetTop);
	}

	function CloseOverlayMenu(ctrl)
	{
		ctrl.style.display = 'none';
	}
	function CloseAllOverlayMenu()
	{
		for(i=0;i<document.all.length;i++)
		{
			if(document.all.item(i).className == 'OverlayMenu')
			{
				CloseOverlayMenu(document.all.item(i))
			}
		}
	}	
	function OpenOverlayMenu(ctrl, root)
	{
		if(ctrl.style.display == 'block') 
		{
			CloseOverlayMenu(ctrl);
			return;
		}
		
		CloseAllOverlayMenu();

		ctrl.style.display = 'block';		
		/*ctrl.style.left = getLeft(root) - ctrl.clientWidth - 4;
		ctrl.style.top = getTop(root);*/
		ctrl.style.left = root.style.left;// + ctrl.style.pixelWidth + ctrl.clientWidth + "px";
		ctrl.style.top = root.offsetTop;// + root.clientHeight + "px";
		ctrl.style.zIndex = 9999;		
	}